import { User } from '@supabase/supabase-js'
import { create } from 'zustand'

interface UserStore {
  user: User
}

const initialState: UserStore = {
  user: {} as User,
}

interface UserActions {
  setUser: (user: User) => void
}

export const useUserStore = create<UserStore & UserActions>(set => ({
  ...initialState,
  setUser: (user: User) => set({ user }),
}))
